package sv.edu.ues.igf115.clave1.dominio;
// Generated 13-nov-2013 1:27:45 by Hibernate Tools 3.2.1.GA


import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Clientetarjeta generated by hbm2java
 */
@Entity
@Table(name="cliente_tarjeta"
    ,catalog="clave1"
)
public class ClienteTarjeta  implements java.io.Serializable {


     private ClientetarjetaId id;
     private TarjetaCredito tarjetacredito;
     private Cliente cliente;
     private Date fechEmision;
     private BigDecimal limiteCredito;
     private BigDecimal puntosTarjeta;

    public ClienteTarjeta() {
    }

	
    public ClienteTarjeta(ClientetarjetaId id, TarjetaCredito tarjetacredito, Cliente cliente) {
        this.id = id;
        this.tarjetacredito = tarjetacredito;
        this.cliente = cliente;
    }
    public ClienteTarjeta(ClientetarjetaId id, TarjetaCredito tarjetacredito, Cliente cliente, Date fechEmision, BigDecimal limiteCredito, BigDecimal puntosTarjeta) {
       this.id = id;
       this.tarjetacredito = tarjetacredito;
       this.cliente = cliente;
       this.fechEmision = fechEmision;
       this.limiteCredito = limiteCredito;
       this.puntosTarjeta = puntosTarjeta;
    }
   
     @EmbeddedId
    
    @AttributeOverrides( {
        @AttributeOverride(name="idcliente", column=@Column(name="id_cliente", nullable=false, length=5) ), 
        @AttributeOverride(name="idtarjeta", column=@Column(name="id_tarjeta", nullable=false, length=5) ) } )
    public ClientetarjetaId getId() {
        return this.id;
    }
    
    public void setId(ClientetarjetaId id) {
        this.id = id;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="id_tarjeta", nullable=false, insertable=false, updatable=false)
    public TarjetaCredito getTarjetacredito() {
        return this.tarjetacredito;
    }
    
    public void setTarjetacredito(TarjetaCredito tarjetacredito) {
        this.tarjetacredito = tarjetacredito;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="id_cliente", nullable=false, insertable=false, updatable=false)
    public Cliente getCliente() {
        return this.cliente;
    }
    
    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="fecha_emision", length=10)
    public Date getFechEmision() {
        return this.fechEmision;
    }
    
    public void setFechEmision(Date fechEmision) {
        this.fechEmision = fechEmision;
    }
    
    @Column(name="LIMITE_CREDITO", precision=11)
    public BigDecimal getLimiteCredito() {
        return this.limiteCredito;
    }
    
    public void setLimiteCredito(BigDecimal limiteCredito) {
        this.limiteCredito = limiteCredito;
    }
    
    @Column(name="PUNTOS_TARJETA", precision=6, scale=0)
    public BigDecimal getPuntosTarjeta() {
        return this.puntosTarjeta;
    }
    
    public void setPuntosTarjeta(BigDecimal puntosTarjeta) {
        this.puntosTarjeta = puntosTarjeta;
    }




}


